var n = getApp();

Page({
    data: {
        language: "",
        amount_total: {},
        amount_surplus: {},
        amount_finish: {},
        exchange_point: {},
        exchange_love: {},
        exchange_point_amount: {},
        exchange_love_amount: {},
        point_name: "",
        love_name: ""
    },
    onLoad: function(n) {
        this.getDetail();
    },
    onReady: function() {
        var n = wx.getStorageSync("langIndex");
        this.setData({
            language: n.en
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    getDetail: function() {
        var a = this, t = n.getNetAddresss("plugin.share-chain.frontend.center.getInfo");
        t += "&supplier_id=" + this.options.id, n._getNetWork({
            url: t,
            success: function(n) {
                var t = n.data;
                1 === t.result ? a.setData({
                    point_name: t.data.point_name,
                    love_name: t.data.love_name,
                    amount_total: t.data.info.amount_total,
                    amount_surplus: t.data.info.amount_surplus,
                    amount_finish: t.data.info.amount_finish,
                    exchange_point: t.data.info.exchange_point,
                    exchange_love: t.data.info.exchange_love,
                    exchange_point_amount: t.data.info.exchange_point_amount,
                    exchange_love_amount: t.data.info.exchange_love_amount
                }) : wx.showToast({
                    title: t.msg,
                    icon: "none"
                });
            },
            fail: function(n) {
                console.log(n);
            }
        });
    }
});